/*
 *  Copyright 2012 Dirk Vranckaert
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package eu.vranckaert.vvl.model;

import java.net.URI;
import java.util.Date;

/**
 * User: DIRK VRANCKAERT
 * Date: 17/02/12
 * Time: 7:25
 */
public class TrafficInfoText {
    private TrafficInfoTextEnum.InformationType informationType;
    private String title;
    private String description;
    private Date publicationDate;
    private URI link;

    public TrafficInfoText(TrafficInfoTextEnum.InformationType informationType, String title, Date publicationDate) {
        this.informationType = informationType;
        this.title = title;
        this.description = title;
        this.publicationDate = publicationDate;
    }

    public TrafficInfoTextEnum.InformationType getInformationType() {
        return informationType;
    }

    public void setInformationType(TrafficInfoTextEnum.InformationType informationType) {
        this.informationType = informationType;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getPublicationDate() {
        return publicationDate;
    }

    public void setPublicationDate(Date publicationDate) {
        this.publicationDate = publicationDate;
    }

    public URI getLink() {
        return link;
    }

    public void setLink(URI link) {
        this.link = link;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof TrafficInfoText)) return false;

        TrafficInfoText that = (TrafficInfoText) o;

        if (informationType != that.informationType) return false;
        if (publicationDate != null ? !publicationDate.equals(that.publicationDate) : that.publicationDate != null)
            return false;
        if (title != null ? !title.equals(that.title) : that.title != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = informationType != null ? informationType.hashCode() : 0;
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (publicationDate != null ? publicationDate.hashCode() : 0);
        return result;
    }
}
